package com.it.operator;

import com.it.pojo.Event;
import com.it.operator.utils.SourceUtils;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 注意泛型擦除的影响：typeHits or TypeInformation
 *
 * @author code1997
 */
public class Operator_Map {

    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment executionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment();
        executionEnvironment.setParallelism(1);
        SingleOutputStreamOperator<Event> eventSource = SourceUtils.getEventSource(executionEnvironment);
        SingleOutputStreamOperator<String> users = eventSource.map(event -> event.user);
        users.print();
        executionEnvironment.execute();

    }
}
